﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
///LastModifyTimeModule 的摘要说明
/// </summary>
public class LastModifyTimeModule : IHttpModule
{

    #region IHttpModule 成员

    public void Dispose()
    {
       
    }

    public void Init(HttpApplication context)
    {
        context.PreSendRequestHeaders += new EventHandler(context_PreSendRequestContent);
    }

    #endregion


    void context_PreSendRequestContent(object sender, EventArgs e)
    {
        HttpApplication application = (HttpApplication)sender;
        HttpContext context = application.Context;
        string url = context.Request.RawUrl.ToLower();
        if (url.IndexOf(".shtml") > -1)
        {
            context.Response.AddHeader("Last-Modified", DateTime.Now.ToString("R"));
        }
    }
}